package com.example.wlt.personnel_manegement_system.Manager.Task;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;

import com.example.wlt.personnel_manegement_system.Adapter.TaskAdapter;
import com.example.wlt.personnel_manegement_system.Item.Item_task;
import com.example.wlt.personnel_manegement_system.R;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created by WLT on 2016/4/24.
 */
public class Taskhistory extends Activity implements AdapterView.OnItemClickListener {
    private Button btn_back;//返回按钮
    private ListView lv_item;//任务历史纪录
    private SimpleAdapter simp_adapter;
    private List<Map<String,Object>>datalist;//数据源
    private TextView tv_head;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.task_history);
        lv_item=(ListView)findViewById(R.id.lv_taskhistory_item);
        btn_back=(Button)findViewById(R.id.btn_org_headleft);
        tv_head=(TextView)findViewById(R.id.tv_top_head);
        tv_head.setText("任务记录");
        lv_item.setOnItemClickListener(this);
        List<Item_task> Item=new ArrayList<>();
        for(int i=0;i<20;i++){
            Item.add(new Item_task(
                            "人事管理f系统"
                    ));
        }
        lv_item.setAdapter(new TaskAdapter(this, this, Item));
        //返回任务页面首页
       btn_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
    //查看所点击任务信息
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        Intent Intent = new Intent(Taskhistory.this,Checkhistory.class);
        startActivity(Intent);
    }
}